home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
2611.ZIP
/
MANIFEST.ZIP
/
SUMPRN.PRG
< prev
next >
Wrap
Text File
|
1988-04-14
|
11KB
|
439 lines
*********************
* SUMPRIN.PRG *
* CHOICE 4, SUB 8 *
* APR 14, 1988 *
* GUY DUBEC *
*********************
@ 10,10 CLEA
STOR ' ' TO CHOICE
@ 11,11 TO 18,68
@ 12,13 SAY '1 - Print a list of Generators'
@ 13,13 SAY '2 - Print a list of Transporters'
@ 14,13 SAY '3 - Print a list of TSD facilities'
@ 15,13 SAY '4 - Print a list of Waste Codes with Volume Totals'
@ 16,13 SAY '5 - Print a list of Handling Codes with Volume ì
Totals'
@ 17,13 SAY 'R - Return to previous menu'
@ 20,13 SAY 'Enter your choice : ' GET CHOICE
READ
DO CASE
CASE CHOICE='1'
@ 7,0 CLEA
STOR 2 TO LINE
STOR 60 TO MAX
STOR 'F' TO END
@ 10,7 SAY 'Full information on all Generators in the system will ì
be printed.'
DO WHIL END='F'
USE FACILITY INDEX FACID
@ 0,0
SET DEVI TO PRIN
IF LINE=2
@ LINE,27 SAY 'Listing of all Generators'
STOR LINE+2 TO LINE
ELSE
@ LINE,5 SAY 'EPA ID & Name : '+EPAID+' '+TRIM(NAME)
STOR LINE+1 TO LINE
@ LINE,5 SAY 'Address : '+TRIM(ADD1)+', '+TRIM(ADD2)
STOR LINE+1 TO LINE
@ LINE,23 SAY TRIM(CITY)+', '+STATE+' ì
'+ZIP+SPACE(5)+'('+SUBSTR(PHONE,1,3)+')'+SUBSTR(PHONE,4,3)+'-'+SUBì
STR(PHONE,7)
STOR LINE+3 TO LINE
IF LINE+3>MAX
EJECT
STOR 2 TO LINE
SKIP
ELSE
SKIP
ENDIF
ENDIF
@ LINE+1,0 SAY ' '
EJECT
SET DEVI TO SCRE
CLOS DATA
ENDDO
CASE CHOICE='2'
@ 7,0 CLEA
STOR 2 TO LINE
STOR 60 TO MAX
STOR 'F' TO END
@ 10,6 SAY 'Full information on all Transporters in the system will ì
be printed.'
DO WHIL END='F'
USE TRANS INDEX TID
@ 0,0
SET DEVI TO PRIN
IF LINE=2
@ LINE,26 SAY 'Listing of all Transporters'
STOR LINE+2 TO LINE
ELSE
@ LINE,5 SAY 'EPA ID & Name : '+EPAID+' '+TRIM(NAME)
STOR LINE+1 TO LINE
@ LINE,5 SAY 'Address : '+TRIM(ADD1)+', '+TRIM(ADD2)
STOR LINE+1 TO LINE
@ LINE,23 SAY TRIM(CITY)+', '+STATE+' ì
'+ZIP+SPACE(5)+'('+SUBSTR(PHONE,1,3)+')'+SUBSTR(PHONE,4,3)+'-'+SUBì
STR(PHONE,7)
STOR LINE+3 TO LINE
IF LINE+3>MAX
EJECT
STOR 2 TO LINE
SKIP
ELSE
SKIP
ENDIF
ENDIF
@ LINE+1,0 SAY ' '
EJECT
SET DEVI TO SCRE
CLOS DATA
ENDDO
CASE CHOICE='3'
@ 7,0 CLEA
STOR 2 TO LINE
STOR 60 TO MAX
STOR 'F' TO END
@ 10,4 SAY 'Full information on all TSD Facilities in the system will ì
be printed.'
DO WHIL END='F'
USE DISP INDEX DID
@ 0,0
SET DEVI TO PRIN
IF LINE=2
@ LINE,24 SAY 'Listing of all TSD Facilities'
STOR LINE+2 TO LINE
ELSE
@ LINE,5 SAY 'EPA ID & Name : '+EPAID+' '+TRIM(NAME)
STOR LINE+1 TO LINE
@ LINE,5 SAY 'Address : '+TRIM(ADD1)+', '+TRIM(ADD2)
STOR LINE+1 TO LINE
@ LINE,23 SAY TRIM(CITY)+', '+STATE+' ì
'+ZIP+SPACE(5)+'('+SUBSTR(PHONE,1,3)+')'+SUBSTR(PHONE,4,3)+'-'+SUBì
STR(PHONE,7)
STOR LINE+3 TO LINE
IF LINE+3>MAX
EJECT
STOR 2 TO LINE
SKIP
ELSE
SKIP
ENDIF
ENDIF
@ LINE+1,0 SAY ' '
EJECT
SET DEVI TO SCRE
CLOS DATA
ENDDO
CASE CHOICE='4'
@ 7,0 CLEA
STOR 'F' TO END
STOR 2 TO LINE
STOR 60 TO MAX
STOR 0 TO COUNT
STOR 000000 TO TOTON, TOT1, TOT2, TOT3, TOT4
STOR SPACE(4) TO EPA, EPA1, EPA2, EPA3, EPA4
STOR SPACE(6) TO STATE, ST1, ST2, ST3, ST4
@ 10,10 SAY 'A listing of EPA Waste Codes, followed by State ì
Waste Codes'
@ 12,13 SAY 'will be printed, each with its total volume ì
disposed.'
@ 14,18 SAY 'Report start date : '+START+' and end date : '+STOP
DO WHIL END='F'
USE WASTE INDEX
INDEX ON EPACODE TO EPAWST
INDEX ON STCODE TO STWST
SET ORDER TO 1
SET FIELDS TO EPACODE, TON
TOTAL ON EPACODE TO TOTS FIELDS TON
SELECT B
USE TOTS
IF EPACODE=' '
SKIP
ELSE
DO WHIL END='F'
SET DEVICE TO PRIN
IF LINE=2
@ LINE,16 SAY 'Listing of EPA Waste Codes and Disposal '+;
'Volumes'
STOR LINE+2 TO LINE
@ LINE,15 SAY 'Code Tons Code Tons '+;
'Code Tons Code Tons'
STOR LINE+1 TO LINE
@ LINE,14 SAY REPLICATE('*',53)
STOR LINE+2 TO LINE
ELSE
DO WHIL EPACODE<>' '
IF LINE=MAX
EJECT
STOR 2 TO LINE
ENDIF
IF EOF()
@ LINE+1,1 SAY ' '
EJECT
SET DEVI TO SCRE
ELSE
IF COUNT=0
STOR COUNT+1 TO COUNT
ENDIF
DO COUNTER
IF COUNT=4
@ LINE,15 SAY EPA1+SPACE(4)+TOT1+SPACE(6)+EPA2+SPACE(4)+;
TOT2+SPACE(6)+EPA3+SPACE(4)+TOT3+SPACE(6)+EPA4+SPACE(4)+TOT4
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=3
@ LINE,15 SAY EPA1+SPACE(4)+TOT1+SPACE(6)+EPA2+;
SPACE(4)+TOT2+SPACE(6)+EPA3+SPACE(4)+TOT3
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=2
@ LINE,15 SAY EPA1+SPACE(4)+TOT1+SPACE(6)+EPA2+;
SPACE(4)+TOT2
STOR 0 TO COUNT
STOR LINE+1 TO LINE
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=1
@ LINE,15 SAY EPA1+SPACE(4)+TOT1
STOR 0 TO COUNT
STOR LINE+1 TO LINE
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
ENDDO
ENDIF
ENDDO
ENDIF
ENDDO
ENDIF
SELECT A
GO TOP
SET ORDER TO 2
ERASE TOTS.DBF
SET FIELDS TO STCODE, TON
TOTAL ON STCODE TO TOTS FIELDS TON
SELECT B
USE TOTS
IF STCODE=' '
SKIP
ELSE
DO WHIL END='F'
SET DEVI TO PRIN
IF LINE=2
@ LINE,16 SAY 'Listing of State Waste Codes and '+;
'Disposal Volumes'
STOR LINE+2 TO LINE
@ LINE,15 SAY 'Code Tons Code Tons '+;
'Code Tons Code Tons'
STOR LINE+1 TO LINE
@ LINE,14 SAY REPLICATE('*',53)
STOR LINE+2 TO LINE
ELSE
DO WHIL STCODE<>' '
IF LINE=MAX
EJECT
STOR 2 TO LINE
ENDIF
IF EOF()
@ LINE+1,1 SAY ' '
EJECT
SET DEVI TO SCRE
ELSE
IF COUNT=0
STOR COUNT+1 TO COUNT
ENDIF
DO COUNTERS
IF COUNT=4
@ LINE,15 SAY ST1+SPACE(4)+TOT1+SPACE(6)+ST2+;
SPACE(4)+TOT2+SPACE(6)+ST3+SPACE(4)+TOT3+SPACE(6)+ST4+SPACE(4)+;
TOT4
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=3
@ LINE,15 SAY ST1+SPACE(4)+TOT1+SPACE(6)+ST2+;
SPACE(4)+TOT2+SPACE(6)+ST3+SPACE(4)+TOT3
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=2
@ LINE,15 SAY ST1+SPACE(4)+TOT1+SPACE(6)+ST2+;
SPACE(4)+TOT2
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=1
@ LINE,15 SAY ST1+SPACE(4)+TOT1
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
ENDDO
ENDIF
ENDDO
ENDIF
ENDDO
ENDIF
CLOSE DATA
ERASE TOTS.DBF
ERASE EPAWST.NDX
ERASE STWST.NDX
ENDDO
CASE CHOICE='5'
@ 7,0 CLEA
STOR 'F' TO END
STOR 2 TO LINE
STOR 60 TO MAX
STOR 0 TO COUNT
STOR 000000 TO TOT1, TOT2, TOT3, TOT4
STOR SPACE(3) TO H1, H2, H3, H4
@ 10,7 SAY 'A listing of Waste Handling Codes, each with total'+;
' volume handled.'
@ 12,7 SAY 'will be printed. Report start date : '+START+' and end'+;
' date : '+STOP
DO WHIL END='F'
SELECT A
USE WASTE
COPY TO TEMP FIELDS HAND1, TON
SELECT B
USE TEMP
SELECT A
GO TOP
DO WHIL .NOT. EOF()
SELECT B
APPEN BLAN
REPL HAND1 WITH A->HAND2
REPL TON WITH A->TON
APPEN BLAN
REPL HAND1 WITH A->HAND3
REPL TON WITH A->TON
APPEN BLAN
REPL HAND1 WITH A->HAND4
REPL TON WITH A->TON
SELECT A
SKIP
ENDDO
SELECT B
INDEX ON HAND1 TO TEMP
GO TOP
TOTAL ON HAND1 TO TEMP1 FIELDS TON
SELECT C
USE TEMP1
IF HAND1=' '
SKIP
ELSE
DO WHIL END='F'
SET DEVI TO PRIN
IF LINE=2
@ LINE,18 SAY 'Listing of Waste Handling Codes and Volumes.'
STOR LINE+2 TO LINE
@ LINE,15 SAY 'Code Tons Code Tons Code'+;
' Tons Code Tons'
STOR LINE+1 TO LINE
@ LINE,14 SAY REPLICATE('*',53)
STOR LINE+2 TO LINE
ELSE
DO WHIL HAND1<>' '
IF LINE=MAX
EJECT
STOR 2 TO LINE
ENDIF
IF EOF()
@ LINE+1,1 SAY ' '
EJECT
SET DEVI TO SCRE
ELSE
IF COUNT=0
STOR COUNT+1 TO COUNT
ENDIF
DO COUNTER5
IF COUNT=4
@ LINE,15 SAY H1+SPACE(4)+TOT1+SPACE(6)+H2+SPACE(4)+;
TOT2+SPACE(6)+H3+SPACE(4)+TOT3+SPACE(6)+H4+SPACE(4)+;
TOT4
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=3
@ LINE,15 SAY H1+SPACE(4)+TOT1+SPACE(6)+H2+SPACE(4)+;
TOT2+SPACE(6)+H3+SPACE(4)+TOT3
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=2
@ LINE,15 SAY H1+SPACE(4)+TOT1+SPACE(6)+H2+SPACE(4)+;
TOT2
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
IF COUNT=1
@ LINE,15 SAY H1+SPACE(4)+TOT1
STOR LINE+1 TO LINE
STOR 0 TO COUNT
IF LINE=MAX
STOR 2 TO LINE
EJECT
ENDIF
ENDIF
ENDDO
ENDIF
ENDDO
ENDIF
ENDDO
ENDIF
CLOSE DATA
ERASE TEMP.DBF
ERASE TEMP.NDX
ERASE TEMP1.DBF
ENDDO
CASE CHOICE='R'
CLEA
RETURN
OTHERWISE
?CHR(7)
STOR ' 'TO CHOICE
ENDCASE